const pkg = require('./package')

module.exports = {
  mode: 'universal',

  /*
  ** Headers of the page
  */
  head: {
    // title: pkg.name,
    title: '07ge_网址导航',
    meta: [
      { charset: 'utf-8' },
      { name: 'keywords', content: '07ge,07哥,灵气阁,灵气哥,网站推荐,网站收藏,网址收藏,上网导航,网址大全,网址导航,07ge上网导航,07ge网址,07ge导航,07ge网址大全,07ge活动,07g,07,抽奖活动'},
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      // { hid: 'description', name: 'description', content: pkg.description }
      { name: 'description', content: '07ge提供最新的网址导航、网站介绍及评分服务。你可以根据你的口味定制自己的导航网站，07ge会推荐好网站给你。' },
      { name: 'author', content: 'lucicol, lucicol505@gmail.com' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
      // { rel: 'alternate', media: 'only screen and(max-width: 640px)', href: 'https://www.baidu.com/' }
    ]
  },

  /*
  ** Customize the progress-bar color
  */
  loading: { color: '#fff' },

  /*
  ** Global CSS
  */
  css: [
    'element-ui/lib/theme-chalk/index.css'
  ],

  /*
  ** Plugins to load before mounting the App
  */
  plugins: [
    '@/plugins/element-ui'
  ],

  /*
  ** Nuxt.js modules
  */
  modules: [
    // Doc: https://github.com/nuxt-community/axios-module#usage
    '@nuxtjs/axios'
  ],
  /*
  ** Axios module configuration
  */
  axios: {
    // See https://github.com/nuxt-community/axios-module#options
    retry: { retries: 3 },
    // debug: process.env._ENV == "production" ? false : true,
    baseURL:
      // process.env._ENV = "https://www.07ge.com",
      process.env.NODE_ENV === "production"
        ? "https://www.07ge.com"
        : "http://127.0.0.1:3000",
    withCredentials: true
  },
  //开启代理
  // proxy: {
  //   "/api/": {
  //     target: "http://192.168.1.2:10086/v1",
  //     pathRewrite: { "^/api/": "" }
  //   }
  // }
  /*
  ** Build configuration
  */
  build: {
    /*
    ** You can extend webpack config here
    */
    extend(config, ctx) {
      // Run ESLint on save
      if (ctx.isDev && ctx.isClient) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/
        })
      }
    }
  }
}
